package com.cjm.thread.zhonjianjian;

import java.util.concurrent.TimeUnit;

public class JoinTest {
    public static void main(String[] args) throws Exception{
        Thread t1 = new Thread(() -> {
            try {
                TimeUnit.MILLISECONDS.sleep(100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.err.println("t1");
        });
        Thread t2 = new Thread(() -> {
            try {
                TimeUnit.MILLISECONDS.sleep(100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.err.println("t2");
        });
        Thread t3 = new Thread(() -> {
            try {
                TimeUnit.MILLISECONDS.sleep(100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.err.println("t3");
        });

        t1.start();
        t2.start();
        t3.start();

//        t1.join();
        t2.join();
//        t3.join();

        System.err.println("over");
    }

}
